<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title>${title}</title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
		<#include "common/am.reference.ftl" />
        <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=m2NXDdtzhhZFjUe0OiH2MANKHphn76xF&s=1"></script>
	</head>
	<body class="${configs["skinName"]}">
		<div class="page-content">
			<div class="row">
			<#if viewMode !="view">
			<#include "common/breadcrumb.ftl">
			</#if>
				<form id="form" role="form" class="form-horizontal" method="post" action="${base}/${form_action}">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-body">
								<input type="hidden" name="id" id="id" value="${model.id}" <#if viewMode == "view">disabled</#if>>
								<#if viewMode == "view">
								<div class="widget-header widget-header-flat">
									<h5 class="lighter">
										${module}
									</h5>
								</div>
								<#else>
								<div class="alert alert-warning">
									<strong>提示!</strong>
									<strong style="color:#dd514c;">出现红框</strong>的表示不能为空
								</div>
								</#if>
								<div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        排班日期
                                    </label>
                                    <div class="col-sm-5" style="margin-left:-11px">
                                        <div class="input-daterange input-group col-sm-8">
                                            <input class="form-control date-picker" id="timeStr" name="timeStr" type="text" value="${model.timeStr}" data-date-format="yyyy-mm-dd" readonly="readonly" />
                                            <span class="input-group-addon">
                                                <i class="fa fa-calendar"></i>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        路线
                                    </label>
                                    <div id="helpCat_div" class="col-sm-5">
                                        <select id="roadId" name="roadId" class="chosen-select width-50 tag-input-style" data-placeholder="请选择路线">
                                            <#if roadList?exists && roadList?size gt 0>
                                                <#list roadList as item>
                                                    <option value="${item.id}" <#if model.roadId == item.id>selected="selected"</#if> >${item.fromTo}</option>
                                                </#list>
                                            </#if>
                                        </select>
                                        <input type="hidden" name="roadName" value="${model.roadName}">
                                    </div>
                                </div>
								<div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                         请选择驾驶员
                                    </label>
                                    <div class="col-sm-3">
                                        <select id="driverOpenid" name="driverOpenid" class="chosen-select form-control" required data-placeholder="请选择驾驶员" <#if viewMode == "view">disabled</#if>>
                                            <#if driverList?exists && driverList?size gt 0>
                                            <#list driverList as item>
                                            <option value="${item.driverOpenid}"<#if model.driverOpenid == item.driverOpenid>selected</#if> >${item.phoneNo}</option>
                                            </#list>
                                            </#if>
                                        </select>
                                        <input type="hidden" name="driverName" value="${model.driverName}">
                                    </div>
                                </div>
                                <!--<div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        车牌号码
                                    </label>
                                    <div class="col-sm-4">
                                        <input type="text" id="carNo" name="carNo" value="${model.carNo}" class="form-control" required placeholder="">
                                    </div>
                                </div>
                                //-->
								<div class="form-group">
                                    <label class="col-sm-3 control-label no-padding-right">
                                        出发时间
                                    </label>
                                    <div id="Gender_div" class="col-sm-5">
                                        <select id="goTime" name="goTime" class="chosen-select width-50 tag-input-style" data-placeholder="请选择出发时间">
                                            <option value="00:00" <#if model.goTime == '00:00'>selected="selected"</#if>  >${item.goTime}00:00</option>
                                            <option value="00:30" <#if model.goTime == '00:30'>selected="selected"</#if>  >${item.goTime}00:30</option>
                                            <option value="01:00" <#if model.goTime == '01:00'>selected="selected"</#if>  >${item.goTime}01:00</option>
                                            <option value="01:30" <#if model.goTime == '01:30'>selected="selected"</#if>  >${item.goTime}01:30</option>
                                            <option value="02:00" <#if model.goTime == '02:00'>selected="selected"</#if>  >${item.goTime}02:00</option>
                                            <option value="02:30" <#if model.goTime == '02:30'>selected="selected"</#if>  >${item.goTime}02:30</option>
                                            <option value="03:00" <#if model.goTime == '03:00'>selected="selected"</#if>  >${item.goTime}03:00</option>
                                            <option value="04:30" <#if model.goTime == '04:30'>selected="selected"</#if>  >${item.goTime}04:30</option>
                                            <option value="04:00" <#if model.goTime == '04:00'>selected="selected"</#if>  >${item.goTime}04:00</option>
                                            <option value="05:30" <#if model.goTime == '05:30'>selected="selected"</#if>  >${item.goTime}05:30</option>
                                            <option value="06:00" <#if model.goTime == '06:00'>selected="selected"</#if>  >${item.goTime}06:00</option>
                                            <option value="06:30" <#if model.goTime == '06:30'>selected="selected"</#if>  >${item.goTime}06:30</option>
                                            <option value="07:00" <#if model.goTime == '07:00'>selected="selected"</#if>  >${item.goTime}07:00</option>
                                            <option value="07:30" <#if model.goTime == '07:30'>selected="selected"</#if>  >${item.goTime}07:30</option>
                                            <option value="08:00" <#if model.goTime == '08:00'>selected="selected"</#if>  >${item.goTime}08:00</option>
                                            <option value="08:30" <#if model.goTime == '08:30'>selected="selected"</#if>  >${item.goTime}08:30</option>
                                            <option value="09:00" <#if model.goTime == '09:00'>selected="selected"</#if>  >${item.goTime}09:00</option>
                                            <option value="09:30" <#if model.goTime == '09:30'>selected="selected"</#if>  >${item.goTime}09:30</option>
                                            <option value="10:00" <#if model.goTime == '10:00'>selected="selected"</#if>  >${item.goTime}10:00</option>
                                            <option value="10:30" <#if model.goTime == '10:30'>selected="selected"</#if>  >${item.goTime}10:30</option>
                                            <option value="11:00" <#if model.goTime == '11:00'>selected="selected"</#if>  >${item.goTime}11:00</option>
                                            <option value="11:30" <#if model.goTime == '11:30'>selected="selected"</#if>  >${item.goTime}11:30</option>
                                            <option value="12:00" <#if model.goTime == '12:00'>selected="selected"</#if>  >${item.goTime}12:00</option>
                                            <option value="12:30" <#if model.goTime == '12:30'>selected="selected"</#if>  >${item.goTime}12:30</option>
                                            <option value="13:00" <#if model.goTime == '13:00'>selected="selected"</#if>  >${item.goTime}13:00</option>
                                            <option value="13:30" <#if model.goTime == '13:30'>selected="selected"</#if>  >${item.goTime}13:30</option>
                                            <option value="14:00" <#if model.goTime == '14:00'>selected="selected"</#if>  >${item.goTime}14:00</option>
                                            <option value="14:30" <#if model.goTime == '14:30'>selected="selected"</#if>  >${item.goTime}14:30</option>
                                            <option value="15:00" <#if model.goTime == '15:00'>selected="selected"</#if>  >${item.goTime}15:00</option>
                                            <option value="15:30" <#if model.goTime == '15:30'>selected="selected"</#if>  >${item.goTime}15:30</option>
                                            <option value="16:00" <#if model.goTime == '16:00'>selected="selected"</#if>  >${item.goTime}16:00</option>
                                            <option value="16:30" <#if model.goTime == '16:30'>selected="selected"</#if>  >${item.goTime}16:30</option>
                                            <option value="17:00" <#if model.goTime == '17:00'>selected="selected"</#if>  >${item.goTime}17:00</option>
                                            <option value="17:30" <#if model.goTime == '17:30'>selected="selected"</#if>  >${item.goTime}17:30</option>
                                            <option value="18:00" <#if model.goTime == '18:00'>selected="selected"</#if>  >${item.goTime}18:00</option>
                                            <option value="18:30" <#if model.goTime == '18:30'>selected="selected"</#if>  >${item.goTime}18:30</option>
                                            <option value="19:00" <#if model.goTime == '19:00'>selected="selected"</#if>  >${item.goTime}19:00</option>
                                            <option value="19:30" <#if model.goTime == '19:30'>selected="selected"</#if>  >${item.goTime}19:30</option>
                                            <option value="20:00" <#if model.goTime == '20:00'>selected="selected"</#if>  >${item.goTime}20:00</option>
                                            <option value="20:30" <#if model.goTime == '20:30'>selected="selected"</#if>  >${item.goTime}20:30</option>
                                            <option value="21:00" <#if model.goTime == '21:00'>selected="selected"</#if>  >${item.goTime}21:00</option>
                                            <option value="21:30" <#if model.goTime == '21:30'>selected="selected"</#if>  >${item.goTime}21:30</option>
                                            <option value="22:00" <#if model.goTime == '22:00'>selected="selected"</#if>  >${item.goTime}22:00</option>
                                            <option value="22:30" <#if model.goTime == '22:30'>selected="selected"</#if>  >${item.goTime}22:30</option>
                                            <option value="23:00" <#if model.goTime == '23:00'>selected="selected"</#if>  >${item.goTime}23:00</option>
                                            <option value="23:30" <#if model.goTime == '23:30'>selected="selected"</#if>  >${item.goTime}23:30</option>

                                        </select>
                                    </div>
                                </div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										是否启用
									</label>
									<div class="col-sm-6">
										<input class="ace ace-switch ace-switch-7" type="checkbox" name="enabled" <#if model == null || model.enabled>checked="checked"</#if> <#if viewMode == "view">disabled</#if>>
										<span class="lbl"></span>
									</div>
								</div>
								<#if viewMode != "view">
								<div class="clearfix form-actions">
									<div class="col-md-offset-3 col-md-9">
										<button id="btnSubmit" class="btn btn-info" type="submit">
											<i class="fa fa-check bigger-110"></i>
											提 交
										</button>
									</div>
								</div>
								</#if>
							</div>
						</div>
					</div>
				</form>
			</div>	
		</div>
		<script type="text/javascript">

		$(function(){
		    $('#roadId').chosen();
            $('#roadId').change(function(){
                var roadId = $(this).val();
                var roadName = $(this).find('option[value="'+roadId+'"]').text();
                $('input[type="hidden"][name="roadName"]').val(roadName);
            });
            $('#roadId').trigger('change');

            $('#driverOpenid').chosen();
            $('#driverOpenid').change(function(){
                var driverOpenid = $(this).val();
                var driverName = $(this).find('option[value="'+driverOpenid+'"]').text();
                $('input[type="hidden"][name="driverName"]').val(driverName);
            });
            $('#driverOpenid').trigger('change');

		    $('.date-picker').datepicker({autoclose:true});

		    $('#goTime').chosen();
            $('#goTime').change(function(){
                var goTime = $(this).val();
            });
            $('#goTime').trigger('goTime');

			$('.chosen-select').chosen();
			$('#form').validator();
		})
		</script>
	</body>
</html>